package com.cn.aam.checaiduo.ui.product.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.cn.aam.checaiduo.R;
import com.cn.aam.checaiduo.base.adapter.BaseRecycerAdapter;
import com.cn.aam.checaiduo.base.adapter.holder.BaseRecyclerViewHolder;

import butterknife.BindView;


/**
 * @author 微木森林
 * @time 2017/6/1 下午3:16
 * @description 详情页项目资料的适配器
 * @remark 专门显示图片
 */
public class ImageOfProductDataAdapter extends BaseRecycerAdapter<String> {


    public ImageOfProductDataAdapter(Context mContext) {
        super(mContext);
    }

    //item
    @Override
    protected BaseRecyclerViewHolder getViewHolder(View picNewsView) {
        return new ItemViewHolder(picNewsView);
    }

    @Override
    protected int getItemLayoutRes() {
        return R.layout.list_item_detail_image_info;
    }


    @Override
    protected void ItemVIewChange(BaseRecyclerViewHolder recyclerholder, final int position) {
        final ItemViewHolder myholdet = (ItemViewHolder) recyclerholder;
        String item = getItem(position);
        Glide.with(mContext).load(item).crossFade().into(myholdet.ivProductData);
    }


    //Item
    class ItemViewHolder extends BaseRecyclerViewHolder {
        @BindView(R.id.iv_product_data)
        ImageView ivProductData;

        ItemViewHolder(View view) {
            super(view);
        }
    }


}